<template>
  <div>
    <h2>薄弱课程列表</h2>
    <el-table :data="weakCourses" border>
      <el-table-column prop="studentName" label="学生姓名" />
      <el-table-column prop="courseName" label="课程名称" />
      <el-table-column prop="score" label="成绩" />
      <el-table-column prop="semester" label="学期" />

    </el-table>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  data() {
    return {
      weakCourses: [] // 薄弱课程数据
    };
  },
  mounted() {
    this.fetchWeakCourses();
  },
  methods: {
    async fetchWeakCourses() {
      try {
        const response = await axios.get('/weak-courses/getAll');
        this.weakCourses = response.data;
      } catch (error) {
        console.error('获取薄弱课程失败', error);
      }
    }
  }
};
</script>

<style scoped>
h2 {
  margin-bottom: 20px;
}
</style>
